/*
 * $Id$
 */

package corejs.expr;

import corejs.rt.ActivationRecord;
import corejs.rt.Value;
import corejs.util.XmlPrinter;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author pengyu
 */
public class ObjectExpr extends HashMap<String, Expression> implements Expression {

   @Override
   public void print(final XmlPrinter printer) {
      printer.open("object");
      for (final Map.Entry<String, Expression> e : entrySet()) {
         printer.open("entry").print("name", e.getKey())
           .print(e.getValue()).close();
      }
      printer.close();
   }

   @Override
   public Object eval(final ActivationRecord scope) {
      return null;
   }

   @Override
   public Value accept(final ExpressionVisitor visitor) {
      return visitor.visitObject(this);
   }
   
}
